﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using System.Threading;
using io = System.IO;

namespace server.app
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        public App()
        {
            Thread.CurrentThread.IsBackground = true;

            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler((o, e) =>
            {
                io.File.AppendAllText(io.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log.txt"),
                    "=========== " + DateTime.Now + " :\r\n" + e.ExceptionObject.ToString() + "\r\n");

                MessageBox.Show(e.ExceptionObject.ToString());
            });
        }
    }
}
